package com.whately.core.base.fileupload.qiniu.util;

import lombok.Data;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;

@Data
@ToString
public class ImageInfoVo {

    private String prefixBeforeDatePath;

    private String bucket;

    private String relativePathAndFileName;

    private String dotAndSuffix;


    public String qiNiuDateFilePathAndName(){
        if(StringUtils.isNotBlank(relativePathAndFileName)){
            return relativePathAndFileName;
        }
        return StringUtils.EMPTY;
    }


    public String fetchFilePathAndName(){
        return StringUtils.defaultString(prefixBeforeDatePath)+ StringUtils.defaultString(relativePathAndFileName);
    }


    public String fetchRelativePath(){
        return StringUtils.defaultString(bucket)+this.fetchFilePathAndName();
    }
}
